/* JavaScript content from scripts/console/controllers/loginCtrl.js in folder common */
define([ "./../controllers/controllers" ], function (controllers) {
    "use strict";

    controllers.controller("pluginCtrl", [ "$scope", "$state", "$localStorage","$stateParams","$timeout",
        function ($scope, $state, $localStorage,$stateParams,$timeout) {

            // $scope.items = [];
            // var base = 0;
            // $scope.load_more = function(){
            //     $timeout(function(){
            //         for(var i=0;i<10;i++,base++)
            //             $scope.items.push(["item ",base].join(""));
            //         $scope.$broadcast("scroll.infiniteScrollComplete");
            //     },500);
            // };

            $scope.backto=function () {
                $state.go("login" );
            }


            $scope.aliPay=function () {
                
                cordova.exec(function (param) {
                    
                }, function (message) {
                    
                }, "PaymentPlugin", "aliPay", []);
            };



            $scope.wxPay=function () {

                cordova.exec(function (param) {

                }, function (message) {

                }, "PaymentPlugin", "wxPay", []);

            };


            //自定义分享
            $scope.shareclick=function () {
                var exec = cordova.require('cordova/exec');
                exec(customShare, customShare, "CustomSharePlugin", "customShare", [1])
            };

            function customShare(data){
                alert("你成功连接IOS 插件 shareclick："+data)
            };




            //二维码/条形码扫描
            $scope.scanclick=function () {
                var exec = cordova.require('cordova/exec');
                exec(scan, scan, "ScanPlugin", "scan", [1])
            };

            function scan(data){
                alert("你成功连接IOS 插件 这是scanclick返回数据："+data)
            };




            //检查网络状态
            $scope.checkwificlick=function () {
                var exec = cordova.require('cordova/exec');
                exec(checkWifiStatus, checkWifiStatus, "CheckWifiStatusPlugin", "checkWifiStatus", [1])
            };

            function checkWifiStatus(data){
                alert("你成功连接IOS 插件 checkwificlick："+data)
            };



            //摇一摇
            $scope.shakeclick=function () {

                var exec = cordova.require('cordova/exec');
                exec(shake, shake, "ShakePlugin", "shake", [1])
            };

            function shake(data){
                alert("你成功连接IOS 插件 shakeclick："+data)
            };


            //图片水印
            $scope.waterclick=function () {

                var exec = cordova.require('cordova/exec');
                exec(waterMarkPhoto, waterMarkPhoto, "WatermarkPhotoPlugin", "waterMarkPhoto", [1])
            };

            function waterMarkPhoto(data){
                alert("你成功连接IOS 插件 waterclick："+data)
            };




            //拍照/选择照片
            $scope.cameraclick=function () {

                var exec = cordova.require('cordova/exec');
                exec(photoWitnSelect, photoWitnSelect, "PhotoWitnSelectPlugin", "photoWitnSelect", [1])
            };

            function photoWitnSelect(data){
                alert("你成功连接IOS 插件 cameraclick："+data)
            };





        } ])

});

